<table cellpadding="5">
	<#if clientInfo??>
	<input name="udid" id="proAddressKey" type="hidden" value="${(clientInfo.udid)!}" />
	<tr>
		<td class="tbLabel">房间号:</td>
		<td>
			<input id="proRoomNo" name="roomNo"  class="easyui-validatebox textbox" data-options="required: true" value="0"/>
		</td>
		<td class="tbLabel">设备号:</td>
		<td>
			<input id="proDeviceNo" name="deviceNo"  class="easyui-validatebox textbox" data-options="required: true" value="0"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">场景控制:</td>
		<td>
			<@eu.comboBox id="proSceneNo" url="common.do?loadComboBox&key=SCENE_MODES&value=0" required="true" name="sceneNo"/>
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(1)"/>
			&nbsp;
<!-- 			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(1)"/> -->
		</td>
	</tr>
	<tr>
		<td class="tbLabel">灯光控制:</td>
		<td>
			<@eu.comboBox id="proLightAction" url="common.do?loadComboBox&key=ACTION_TYPE&value=0" required="true" name="actionType"/>
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(2)"/>
			&nbsp;
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(3)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">窗帘控制:</td>
		<td>
			<@eu.comboBox id="proCurtainAction" url="common.do?loadComboBox&key=ACTION_TYPE&value=0" required="true" name="actionType"/>
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(4)"/>
			&nbsp;
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(5)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">空调控制:</td>
		<td>
			<@eu.comboBox id="proAirAction" url="common.do?loadComboBox&key=AIR_ACTION_TYPE&value=0" required="true" name="actionType"/>
		</td>
		<td>
<!-- 			模式： -->
			<@eu.comboBox id="proAirModes" url="common.do?loadComboBox&key=AIR_MODES&value=0" required="true" name="actionType"/>
		</td>
		<td>
<!-- 			风速： -->
			<@eu.comboBox id="proAirSpeed" url="common.do?loadComboBox&key=AIR_SPEED&value=0" required="true" name="actionType"/>
		</td>
		<td>
			<input id="proAirTemp" class="easyui-numberspinner" data-options="min:20,max:32" value="25" />  
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(6)"/>
			&nbsp;
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(7)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">防区数据:</td>
		<td colspan="2">
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(8)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">开关（电器）控制</td>
		<td>
			<@eu.comboBox id="proSwitchAction" url="common.do?loadComboBox&key=AIR_ACTION_TYPE&value=0" required="true" name="actionType"/>
		</td>
		<td>
			<@eu.comboBox id="proSwitchType" url="common.do?loadComboBox&key=SWITCH_TYPE&value=1" required="true" name="switchType"/>
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(9)"/>
			&nbsp;
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(10)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel"> 电视/机顶盒控制</td>
		<td>
			<input id="proTvAction" class="easyui-numberspinner" data-options="min:0,max:31" value="20" /> 
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(11)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">对码控制</td>
		<td>
			<@eu.comboBox id="proCheckType" url="common.do?loadComboBox&key=CHECK_TYPE&value=0" required="true" name="checkType"/>
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(12)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">清除配置</td>
		<td colspan="2">
			<@eu.linkbutton showName="清除" iconCls="icon-redo" onclick="control(13)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel" rowspan="2">场景配置</td>
		
		<td>
			<@eu.comboBox id="proConfigSceneNo" url="common.do?loadComboBox&key=SCENE_MODES&value=0" required="true" name="configSceneNo"/>
		</td>
		<td>
			<@eu.comboBox id="proConfigDeviceType" url="common.do?loadComboBox&key=DEVICE_TYPE&value=0" required="true" name="configDeviceType"/>
		</td>
		<td>
			<@eu.comboBox id="proConfigAction" url="common.do?loadComboBox&key=ACTION_TYPE&value=0" required="true" name="configAction"/>
		</td>
		<td>
			<input id="proConfigTvAction" class="easyui-numberspinner" data-options="min:0,max:31" value="20" name="configTvAction"/> 
		</td>
		
		<td colspan="2" rowspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(14)"/>
		</td>
	</tr>
	<tr>
		<td>
<!-- 			模式： -->
			<@eu.comboBox id="proConfigAirModes" url="common.do?loadComboBox&key=AIR_MODES&value=0" required="true" name="configAirModes"/>
		</td>
		<td>
<!-- 			风速： -->
			<@eu.comboBox id="proConfigAirSpeed" url="common.do?loadComboBox&key=AIR_SPEED&value=0" required="true" name="configAirSpeed"/>
		</td>
		<td>
			<input id="proConfigAirTemp" class="easyui-numberspinner" data-options="min:20,max:32" value="25" name="configAirTemp"/>  
		</td>
	</tr>
	<tr>
		<td class="tbLabel">网络测试</td>
		<td>
			<input id="proNetWorkIp" name="netWorkIp"  class="easyui-validatebox textbox" data-options="required: true" value="192.168.0.123"/>
		</td>
		<td>
			<input id="proNetWorkPort" name="netWorkPort"  class="easyui-validatebox textbox" data-options="required: true" value="3001"/>			
		</td>
		
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(15)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">设置临时密码</td>
		<td>
			<input id="proPassword" name="password"  class="easyui-validatebox textbox" data-options="required: true" value="12345678"/>
		</td>
		<td>
			时间<input id="proTime" name="time" style="width:30px;" class="easyui-validatebox textbox" data-options="required: true" value="5"/>	秒	
		</td>
		
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(16)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">门锁控制</td>
		<td>
			<@eu.comboBox id="proLockType" url="common.do?loadComboBox&key=LOCK_TYPE&value=mlock" required="true"/>
		</td>
		<td>
			<input id="proLockAction" name="lockAction"  class="easyui-validatebox textbox" data-options="required: true" value="0"/>
		</td>
		
		
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(17)"/>
			&nbsp;
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(18)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">新风控制:</td>
		<td>
			<@eu.comboBox id="proFreshAction" url="common.do?loadComboBox&key=AIR_ACTION_TYPE&value=0" required="true" />
		</td>
		<td>
<!-- 			模式： -->
			<@eu.comboBox id="proFreshModes" url="common.do?loadComboBox&key=AIR_MODES&value=0" required="true" />
		</td>
		<td>
<!-- 			风速： -->
			<@eu.comboBox id="proFreshSpeed" url="common.do?loadComboBox&key=AIR_SPEED&value=0" required="true" />
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(19)"/>
			&nbsp;
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(20)"/>
		</td>
	</tr>
	
	<tr>
		<td class="tbLabel">地暖控制</td>
		<td>
			状态<input id="proFeheatAction" style="width:30px;" class="easyui-validatebox textbox" data-options="required: true" value="0"/>
		</td>
		<td>
			模式<input id="proFeheatMode" style="width:30px;" class="easyui-validatebox textbox" data-options="required: true" value="0"/>
		</td>
		<td>
			温度<input id="proFeheatTemp" style="width:30px;" class="easyui-validatebox textbox" data-options="required: true" value="22"/>
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(21)"/>
			&nbsp;
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(22)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">音乐控制</td>
		<td>
			开关<input id="proMusicAction" style="width:30px;" class="easyui-validatebox textbox" data-options="required: true" value="0"/>
		</td>
		<td>
			播放<input id="proMusicPlay" style="width:30px;" class="easyui-validatebox textbox" data-options="required: true" value="0"/>
		</td>
		<td>
			切换歌曲<input id="proMusicItem" style="width:30px;" class="easyui-validatebox textbox" data-options="required: true" value="0"/>
		</td>
		<td>
			音量<input id="proMusicVolume" style="width:30px;" class="easyui-validatebox textbox" data-options="required: true" value="22"/>
		</td>
		
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(23)"/>
			&nbsp;
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(24)"/>
		</td>
	</tr>
	
	<tr>
		<td class="tbLabel">水精灵</td>
		<td colspan="2">
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(25)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">空气检测仪</td>
		<td colspan="2">
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(26)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">温湿度状态</td>
		<td colspan="2">
			<@eu.linkbutton showName="读取" iconCls="icon-undo" onclick="control(27)"/>
		</td>
	</tr>
	<tr>
		<td class="tbLabel">布防撤防控制</td>
		<td>
			布防/撤防<input id="proDefEnable" style="width:30px;" class="easyui-validatebox textbox" data-options="required: true" value="0"/>
		</td>
		<td>
			设备类型<input id="proDefDevType" style="width:60px;" class="easyui-validatebox textbox" data-options="required: true" value="gasSen"/>
		</td>
		<td colspan="2">
			<@eu.linkbutton showName="控制" iconCls="icon-redo" onclick="control(28)"/>
		</td>
	</tr>
	<#else>
	<tr>
		<td class="tbLabel" style="color:red;">客户端已断开</td>
	</tr>
	</#if>
</table>
<script type="text/javascript">
// 19：新风控制（roomNo、deviceNo、status、airModes、airSpeed参数必传）；
// 20：读取新风状态（roomNo、deviceNo参数必传）；
// 21：地暖控制（status、mode、temp参数必传）；
// 22：读取地暖（roomNo、deviceNo参数必传）；
// 23：背景音乐控制（roomNo、deviceNo、status、play、item、volume参数必传）；
// 24：读取背景音乐状态（roomNo、deviceNo参数必传）；
// 25：读取水精灵状态（roomNo、deviceNo参数必传）；
// 26：读取空气检测仪状态（roomNo、deviceNo参数必传）；
// 27：读取温湿度状态（roomNo、deviceNo参数必传）；
// 28：防区布防撤防控制（deviceNo、enable、devType参数必传）；
// 29：
	function control(type) {
		var devType= "";
		if(type==17||type==18) {
			devType = $('#proLockType').combobox('getValue')
		}
		var data = {
			udid:$('#proAddressKey').val(),
			type:type,
			roomNo:$('#proRoomNo').val(),
			deviceNo:$('#proDeviceNo').val(),
			sceneNo:$('#proSceneNo').combobox('getValue'),
			lightAction:$('#proLightAction').combobox('getValue'),
			curtainAction:$('#proCurtainAction').combobox('getValue'),
			airAction:$('#proAirAction').combobox('getValue'),
			airModes:$('#proAirModes').combobox('getValue'),
			airSpeed:$('#proAirSpeed').combobox('getValue'),
			airTemp:$('#proAirTemp').numberspinner('getValue'),
			switchAction:$('#proSwitchAction').combobox('getValue'),
			switchType:$('#proSwitchType').combobox('getValue'),
			tvAction:$('#proTvAction').numberspinner('getValue'),
			checkType:$('#proCheckType').combobox('getValue'),
			netWorkIp:$('#proNetWorkIp').val(),
			netWorkPort:$('#proNetWorkPort').val(),
			configSceneNo:$('#proConfigSceneNo').combobox('getValue'),
			configDeviceType:$('#proConfigDeviceType').combobox('getValue'),
			configAction:$('#proConfigAction').combobox('getValue'),
			configTvAction:$('#proConfigTvAction').numberspinner('getValue'),
			configAirModes:$('#proConfigAirModes').combobox('getValue'),
			configAirSpeed:$('#proConfigAirSpeed').combobox('getValue'),
			configAirTemp:$('#proConfigAirTemp').numberspinner('getValue'),
			lockType: "",
			pwd: $('#proPassword').val(),
			time: $('#proTime').val(),
			devType: devType,
			lockAction:$('#proLockAction').val(),
			status:255,
			mode:0,
			temp:22,
			play:255,
			item:255,
			volume:255,
			enable:0
		};
		
		switch(type) {
		case 19:
			//新风控制
			data.status = $('#proFreshAction').combobox('getValue');
			data.airModes = $('#proFreshModes').combobox('getValue');
			data.airSpeed = $('#proFreshSpeed').combobox('getValue');
			break;
		case 21:
			//地暖控制
			data.status = $('#proFeheatAction').val();
			data.mode = $('#proFeheatMode').val();
			data.temp = $('#proFeheatTemp').val();
			break;
		case 23:
			//音乐控制
			data.status = $('#proMusicAction').val();
			data.play = $('#proMusicPlay').val();
			data.item = $('#proMusicItem').val();
			data.volume = $('#proMusicVolume').val();
			break;
		case 28:
			//布防撤防控制
			data.enable = $('#proDefEnable').val();
			data.devType = $('#proDefDevType').val();
			break;
		}
		printLog(data);
		onLoadingHandler(function() {
			$.post('rtcs.do?testProcotol',data,function(result){
	            showMsg(result.msg+"，操作结果："+result.obj,5000);
	            removeload();
	        },'json');
		});
		
	}
</script>
